function reduce(arr, callback, initialValue) {
    console.log('reduce', arr, callback, initialValue)
    let result = initialValue

    // 遍历数组
    for (let i = 0; i < arr.length; i++) {
        result = callback(result, arr[i], i)
    }
    return result
}